﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZLDC.Common.Estate;

namespace ZLDC.Estate.AM
{
    public partial class DeptUserList : _PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnExport_Click(object sender, EventArgs e)
        {
            string condition="";
            try
            {
                condition = Session["deptuserlist"].ToString();

            }
            catch 
            {
            
            }

            if (condition == "") 
            {
                return;
            }

            string Sql = "select salesmanid  as '人员编号', salesman as '人员名称', SUM(hfollow)as '盘源跟进',SUM(cfollow)as '客源跟进'" +
                                 ",SUM(look)as '待看提醒',SUM(looked) as '已带看(售)',SUM([mark3])as '已带看(租)',SUM(newhousing)as '新增盘(售)'" +
                                 ",SUM([mark1])as '新增盘(租)'  " +
                                 ",SUM(newcustomer)as '新增客(买)'" +
                                  ",SUM([mark2])as '新增客(租)'" +
                                 ",SUM(only)as '独家'" +
                                 ",SUM(versa)as '反签'" +
                                 ",SUM([key])as '钥匙'" +
                                 ",SUM(telphone)as '查看电话' " +
                                 ",SUM(hasphoto)as '上传图片盘源' " +
                                 ",SUM(photo)as '上传图片数 '      " +
                                 ",SUM([self])as '自看房源'    " +
                                 ",SUM([mark4])as '新转客(买)'" +
                                 ",SUM([mark5])as '新转客(租)'" +
                                 ",SUM(visit) as '家访'   " +
                                 ",SUM(EarnestMoney) as '诚意金'" +
                                 ",SUM(talks) as '摆台'   " +
                                 ",SUM(afterservice) as '售后服务'" +
                                 "  from t_quantification as t " + condition + " group by salesmanid,salesman";


            PageExport.ExportDsToXls(this.Page, "report", Sql);
        }
    }
}
